<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

<!--头部导航栏-->
<nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0" th:fragment="topbar">
    <b class="navbar-brand col-sm-3 col-md-2 mr-0">[[${session.loginUser}]]</b>
    <ul class="navbar-nav px-3">
        <li class="nav-item text-nowrap">
            <a class="nav-link" th:href="@{/logout}">注销</a>
        </li>
    </ul>
</nav>

<!--侧边导航栏-->
<nav class="col-md-2 d-none d-md-block bg-light sidebar" th:fragment="sidebar">
    <div class="sidebar-sticky">
        <ul class="nav flex-column">
            <li class="nav-item">
                <div shiro:hasRole="student">
                    <a th:class="${active=='select'?'nav-link active' :'nav-link '}" th:href="@{/stu/queryCourse}">选课</a>
                    <a th:class="${active=='myselect'?'nav-link active' :'nav-link '}" th:href="@{/stu/querySelect}">已选课程</a>
                </div>
                <div shiro:hasAnyRoles="teacher,admin">
                    <a th:class="${active=='course'?'nav-link active' :'nav-link '}" th:href="@{/admtea/queryCourse}">课程列表</a>
                </div>
                <div shiro:hasRole="teacher">
                    <a th:class="${active=='mycourse'?'nav-link active' :'nav-link '}" th:href="@{/tea/queryMyCourse}">我的课程</a>
                </div>
                <div shiro:hasRole="admin">
                    <a th:class="${active=='selectmanage'?'nav-link active' :'nav-link '}" th:href="@{/admin/selectManage}">选课管理</a>
                    <a th:class="${active=='student'?'nav-link active' :'nav-link '}" th:href="@{/admin/queryStudent}">学生列表</a>
                    <a th:class="${active=='teacher'?'nav-link active' :'nav-link '}" th:href="@{/admin/queryTeacher}">老师列表</a>
                    <a th:class="${active=='college'?'nav-link active' :'nav-link '}" th:href="@{/admin/queryCollege}">学院列表</a>
                </div>
                <a th:class="${active=='info'?'nav-link active' :'nav-link '}" th:href="@{/user/toInfo}">用户信息</a>
                <a th:class="${active=='pwd'?'nav-link active' :'nav-link '}" th:href="@{/user/toPwd}">密码修改</a>
            </li>

        </ul>
    </div>
</nav>


</html>